<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title></title>
    <link rel="stylesheet" href="/css/element.css" />
</head>
<script src="/js/Vue.js"></script>
<script src="/js/element.js"></script>
<script src="/js/axios.js"></script>
<script src="/js/formDataUtils.js"></script>
<script src="/js/jquery.min.js"></script>
<script type="text/javascript" src="/js/layer.js"></script>
<style>
    #tools .el-card__body {
        padding: 5px 5px 5px 20px;
    }
    .el-link {
        margin-right:8px;
    }
    #tools .el-button {
        padding: 10px 8px 10px 5px;
    }
    #template {
        height:100%;
    }
    /* #search .el-card__body {
        height:40px;
    } */
    #table {
        height:calc(100% - 120px);
    }
    /*翻页样式*/
    .el-pagination {
        margin-top:5px;
    }
    #tools .el-button {
        padding: 10px 8px 10px 5px;
        background-color:whitesmoke !important;
        color: black !important;
        border: none !important;
      }
      .el-form-item label{
        text-align: left !important;
        width: 68px !important;
        vertical-align: middle;
        float: left;
        font-size: 14px;
        color: #606266;
        line-height: 40px;
        padding: 0 12px 0 0;
        -webkit-box-sizing: border-box;
        box-sizing: border-box;
      }
</style>
<div id="template">
    <!--    用户编辑框-->
    <el-card class="box-card" id="search" >
        <el-form :inline="true" class="demo-form-inline">
          <template>
            <el-tree
              highlight-current=true
              :data="datetree"
              :props="defaultProps"
              accordion
              @node-click="handleNodeClick">
            </el-tree>
          </template>
        </el-form>
</div>
<script>
    Vue.config.productionTip = false;//屏蔽提示信息
    //当前编辑的场景数据
    var datetree = parent.datetree;
    var tem = new Vue({
        el: "#template",
        data() {
            return {
              datetree:datetree,
              chooseid:'',
              choosename:'',
              defaultProps: {
                children: 'children',
                label: 'name'
              }
            }
        },
        created() {

         },

        methods:{
            setParam(){
                //parent.addeptname = this.nName;
                //console.log(parent.parent);
                //console.log(typeof(parent.parent))
                //console.log(parent.parent.addname);
            },

            handleNodeClick(data){
              // console.log('choosedata :',data);

              //console.log(this.treeData)
              this.chooseid = data.id;
              this.choosename = data.name;
              parent.vue.choosedeptname=this.choosename;
              parent.vue.choosedeptid=this.chooseid;
              console.log('choosedata id:',this.chooseid);
              console.log('choosedata name:',this.choosename);
            },
        }

    })
</script>

</html>
